<!--<%@ page import="bean.Teacher" %>
<%@ page import="bean.Student" %>
<%@ page import="java.util.Enumeration" %>
<%@ page import="java.sql.*" %><%--
Created by IntelliJ IDEA.
User: 86177
Date: 2023/6/24
Time: 15:21
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>-->
<html>
<meta charset="UTF-8">
<head>
    <title>Title</title>
    <%!
        Connection connection=null;
        PreparedStatement pre=null;
        ResultSet res=null;
        String sql="select * from teacher where teacherid="+"?";

    %>
    <%
        Teacher stu= (Teacher) request.getSession().getAttribute("user");
        try {
            Class.forName("com.mysql.jdbc.Driver");
            connection= DriverManager.getConnection("jdbc:mysql://localhost:3306/library", "root", "20030607");
        }catch (Exception e){
            out.print(e);
            e.printStackTrace();
        }
    %>
    <style>
        .head{
            background-color: #9c9191;
            color: white;
            width: 100%;
            height: 8%;
            text-align: center;
            margin: 0 auto;
        }
        .body{
            width: 100%;
            height: 90%;
        }
        .one{
            float: left;
            width: 418.5px;
            margin: 0 auto;
            height: 100%;
            background-color: white;
        }
        .two{
            float: right;
            width: 650px;
            height: 100%;
            margin: 0 auto;
            background-color: white;
        }
        .h{
            text-align: center;
            width: 100%;
            height: 9%;
            background-color: #ffe9cc;
            color:black;
            text-align: center;
            margin: 20px auto;
        }
        .body_one{
            height:500px;
            width: 450px;
            margin: 10px auto;
        }
        .body_one table{
            text-align: center;
            margin: 0 auto;
        }
        .body_one  tr{
            height: 40px;
        }
        .body_one  td{
            width:100px;
        }
        .body_two{
            height: 5%;
        }
        .body_three{
            height: 10%;
            width: 80%;
            text-align: center;

        }
        a{
            background-color: #ff6d5e;
            color: white;
            text-decoration: none;
            font-size: 20px;
            font-weight: bolder;
            margin: 0 auto;
        }
        .fr{
            width: 100%;
            height: 83%;
        }
        .hh{
            text-align: center;
            width: 100%;
            height:9%;
            background-color:#ffe9cc;
            color: black;
            text-align: center;
            margin: 20px auto;
        }
        .bb{
            background-color: #ff4641;
            color: white;
            cursor: pointer;
        }
    </style>
</head>
<body>
<!--stu.getsid()-->
<%
    try {
        pre=connection.prepareStatement(sql);
        pre.setString(1,stu.gettid());
        res= pre.executeQuery();
        res.next();
    }catch (Exception e){
        out.print(e);
        e.printStackTrace();
    }
%>
<div class="head"><h1>用户信息</h1></div>
<div class="body">
    <div class="one">
        <div class="h"><h1>基本信息</h1></div>
        <div class="body_one">
            <table border="1px"  >
                <tr>
                    <td>姓名:</td> <td><%out.print(res.getString("name"));%></td>
                </tr>
                <tr>
                    <td>职位:</td> <td><%out.print(res.getString("title"));%></td>
                </tr>
                <tr>
                    <td>用户id:</td> <td><%out.print(res.getString("teacherid"));%></td>
                </tr>
                <tr>
                    <td>密码:</td> <td><%out.print(res.getString("password"));%></td>
                </tr>
                <tr>
                    <td>学院:</td> <td><%out.print(res.getString("department"));%></td>
                </tr>
                <tr>
                    <td>电话号码:</td> <td><%out.print(res.getString("phone"));%></td>
                </tr>
                <tr>
                    <td>邮箱:</td> <td><%out.print(res.getString("email"));%></td>
                </tr>
                <tr>
                    <td>信誉分:</td> <td><%out.print(res.getString("credit score"));%>分</td>
                </tr>
            </table>
            <div class="body_two"></div>
            <div class="body_three"><form action="TeaChangeServlet" method="post">
                <input type="text" hidden="hidden" value="<%out.print(res.getString("teacherid"));%>" name="id">
                <input type="submit" value="修改信息" class="bb"></form></div>
        </div>
    </div>
    <div class="two">
        <div><h1 class="hh">预约记录</h1></div>
        <iframe src="TeacherHistory.jsp" class="fr"></iframe>
    </div>
</div>
</body>
</html>